<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-2ZWTLF6MFJ"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'G-2ZWTLF6MFJ');
    </script>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Lightue</title>
  </head>
  <body>
    <script src="https://unpkg.com/lightuepress@0.1.6/dist/lightuepress.min.js"></script>
    <script>
      if (location.hash == '') location.hash = navigator.language.slice(0, 2) == 'zh' ? '#/zh/' : '#/'

      var servers = [
        {
          text: 'Netlify',
          link: 'https://lightue.netlify.app',
        },
        {
          text: 'Vercel',
          link: 'https://lightue.vercel.app',
        },
        {
          text: 'Cloudflare',
          link: 'https://lightue.pages.dev',
        },
      ]
      servers.forEach((s) => (s.active = s.link == location.origin))

      Lightuepress({
        repo: 'smalllong/lightue',
        docsDir: 'docs',
        docsBranch: 'master',
        editLinks: true,

        locales: {
          '/': {
            lang: 'en-US',
            title: 'Lightue',
            description: 'A lightweight and simple web frontend model-view framework inspired by Vue.js',
            label: 'English',
            selectText: 'Languages',
            ariaLabel: 'Select language',
            editLinkText: 'Edit this page on GitHub',
            nav: [
              { text: 'Guide', link: '/', activeMatch: '^/$|^/guide/' },
              {
                text: 'API',
                link: '/api/global',
                activeMatch: '^/api/',
              },
              {
                text: 'Servers',
                items: servers,
              },
            ],
            sidebar: {
              '/guide/': getGuideSidebar(''),
              '/api/': getAPISidebar(''),
              '/': getGuideSidebar(''),
            },
          },
          '/zh/': {
            lang: 'zh-CN',
            title: 'Lightue',
            description: '一个启发自Vue.js的轻量简单的web前端框架',
            label: '简体中文',
            selectText: '选择语言',
            ariaLabel: '选择语言',
            editLinkText: '在 GitHub 上编辑此页',
            nav: [
              { text: '教程', link: '/', activeMatch: '^/$|^/guide/' },
              {
                text: 'API',
                link: '/api/global',
                activeMatch: '^/api/',
              },
              {
                text: '服务器',
                items: servers,
              },
            ],
            sidebar: {
              '/guide/': getGuideSidebar('/zh'),
              '/api/': getAPISidebar('/zh'),
              '/': getGuideSidebar('/zh'),
            },
          },
        },
      })

      function getGuideSidebar(dir) {
        return dir == ''
          ? [
              {
                text: 'Introduction',
                children: [
                  { text: 'What is Lightue?', link: '/' },
                  { text: 'Install', link: '/guide/install' },
                ],
              },
              {
                text: 'Essentials',
                children: [
                  { text: 'Getting Started', link: '/guide/getting-started' },
                  { text: 'Template Syntax', link: '/guide/template-syntax' },
                  { text: 'State Driven', link: '/guide/state' },
                  { text: 'Conditional Rendering', link: '/guide/conditional' },
                  { text: 'Component', link: '/guide/component' },
                ],
              },
            ]
          : [
              {
                text: '介绍',
                children: [
                  { text: 'Lightue是什么?', link: '/' },
                  { text: '安装', link: '/guide/install' },
                ],
              },
              {
                text: '基础',
                children: [
                  { text: '开始上手', link: '/guide/getting-started' },
                  { text: '模板语法', link: '/guide/template-syntax' },
                  { text: '状态驱动', link: '/guide/state' },
                  { text: '条件渲染', link: '/guide/conditional' },
                  { text: '组件', link: '/guide/component' },
                ],
              },
            ]
      }

      function getAPISidebar(dir) {
        return dir == ''
          ? [
              {
                text: 'API',
                children: [
                  { text: 'Global methods', link: '/api/global' },
                  { text: 'VDomSrc', link: '/api/template' },
                ],
              },
            ]
          : [
              {
                text: 'API',
                children: [
                  { text: '全局方法', link: '/api/global' },
                  { text: 'VDomSrc', link: '/api/template' },
                ],
              },
            ]
      }
    </script>
  </body>
</html>
